<?php
  date_default_timezone_set("Europe/Madrid");

  header('Content-type: application/xml+rss');

  $os = $_SERVER['HTTP_USER_AGENT'];
  $os = strtolower($os);
  $os_local = PHP_OS;

  $rssfeed = '<?xml version="1.0" encoding="utf-8"?>'."\n";
  $rssfeed .= '<rss version="2.0">'."\n";
  $rssfeed .= ' <channel>'."\n";
  $rssfeed .= '  <title>RSS</title>'."\n";
  $rssfeed .= '  <link>http://hp</link>'."\n";
  $rssfeed .= '  <description>Información</description>'."\n";
  $rssfeed .= '  <language>es-es</language>'."\n";
  $rssfeed .= '  <copyright>Copyright (C) 2028</copyright>'."\n";

  $os_cliente = "";

  if(strpos($os, "linux") !== false) {
    $os_cliente = "Linux";
  }  else {
    $os_cliente = "Otros";
  }

  $rssfeed .= '  <item>'."\n";
  $rssfeed .= '   <title>' . "OS_CLIENTE" . '</title>'."\n";
  $rssfeed .= '   <description>' . $os_cliente . '</description>'."\n";
  $rssfeed .= '   <link>' . "http://localhost" . '</link>'."\n";
  $rssfeed .= '   <pubDate>' . date("r") . '</pubDate>'."\n";
  $rssfeed .= '  </item>'."\n";

  $rssfeed .= '  <item>'."\n";
  $rssfeed .= '   <title>' . "IP_CLIENTE" . '</title>'."\n";
  $rssfeed .= '   <description>' . "$_SERVER[REMOTE_ADDR]" . '</description>'."\n";
  $rssfeed .= '   <link>' . "http://localhost" . '</link>'."\n";
  $rssfeed .= '   <pubDate>' . date("r") . '</pubDate>'."\n";
  $rssfeed .= '  </item>'."\n";

  $rssfeed .= '  <item>'."\n";
  $rssfeed .= '   <title>' . "PWD_SERVIDOR" . '</title>'."\n";
  $rssfeed .= '   <description>' . "$_SERVER[PHP_SELF]" . '</description>'."\n";
  $rssfeed .= '   <link>' . "http://localhost" . '</link>'."\n";
  $rssfeed .= '   <pubDate>' . date("r") . '</pubDate>'."\n";
  $rssfeed .= '  </item>'."\n";

  $rssfeed .= '  <item>'."\n";
  $rssfeed .= '   <title>' . "OS_SERVIDOR" . '</title>'."\n";
  $rssfeed .= '   <description>' . "$os_local" . '</description>'."\n";
  $rssfeed .= '   <link>' . "http://localhost" . '</link>'."\n";
  $rssfeed .= '   <pubDate>' . date("r") . '</pubDate>'."\n";
  $rssfeed .= '  </item>'."\n";

  $rssfeed .= '  <item>'."\n";
  $rssfeed .= '   <title>' . "IP_SERVIDOR" . '</title>'."\n";
  $rssfeed .= '   <description>' . "$_SERVER[SERVER_NAME]" . '</description>'."\n";
  $rssfeed .= '   <link>' . "http://localhost" . '</link>'."\n";
  $rssfeed .= '   <pubDate>' . date("r") . '</pubDate>'."\n";
  $rssfeed .= '  </item>'."\n";

  $rssfeed .= ' </channel>'."\n";
  $rssfeed .= '</rss>'."\n";

  echo $rssfeed;
?> 
